﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;

namespace POS
{
    public abstract class Order
    {
        public Order(string name, double price, double rating)
        {
            this.Name = name;
            this.Price = price;
            this.Rating = rating;
        }

        public string Name { get; protected set; }
        public double Price { get; protected set; }
        public double Rating { get; protected set; }

        public UIElement Render()
        {
            var container = new UniformGrid();
            container.HorizontalAlignment = HorizontalAlignment.Stretch;
            container.Columns = 3;
            
            //creating the TextBox
            var textTextBox = new TextBlock();
            textTextBox.Text = this.Name;
            textTextBox.FontWeight = FontWeights.Bold;
          
            textTextBox.FontSize = 11;
            container.Children.Add(textTextBox);

            var textTextBox2 = new TextBlock();
            textTextBox2.Text = " " + this.Price.ToString() + "$";
            textTextBox2.FontWeight = FontWeights.Bold;
            textTextBox2.FontSize = 11;
            container.Children.Add(textTextBox2);
             
            //creating the Delete button
            var deleteButton = new Button();
            deleteButton.Width = 110;
            deleteButton.Content = "Remove";
            container.Children.Add(deleteButton);
            deleteButton.HorizontalAlignment = HorizontalAlignment.Stretch;

            return container;
        }
    }
}
